package ar.com.angrymachine.hunter.gameplay;

import java.awt.Image;

public abstract class Spell
{
    public String name;
    public int castingTime;
    public boolean permanent = false;
    public Image icon;
    public int instances;
    
    protected Spell(String name, Image icon, int castingTime, boolean permanent, int instances)
    {
        this.icon = icon;
        this.permanent = permanent;
        this.name = name;
        this.castingTime = castingTime;
        this.instances = instances;
    }
    
    public int getInstances()
    {
        if(permanent)
        {
            return -1;
        }
        else
        {
            return instances;
        }
    }
    
    public boolean isAvailable()
    {
        return permanent || instances > 0;
    }
    
    public void cast()
    {
        instances--;
    }

    public void castOnCharacter(Character character)
    {
    }
}
